#include <iostream>
#include <vector>
using namespace std;
vector<int> factor;
bool judge(int a)
{
    for (size_t i = 1; i < factor.size() - 1; i++) // 注意这里的范围。将1和其本身排除
    {
        if (a % factor[i] == 0)
        {
            return false;
        }
    }
    return true;
}
int main()
{
    vector<int> pri_num;
    int a = 1;
    int b = 2022;
    while (a <= b)
    {
        factor.push_back(a);
        if (judge(a))
        {
            pri_num.push_back(a);
            a += 2;
        }
        else
            a += 2;
    }
    int i = 0, j = pri_num.size();
    while (i <= j)
    {
        if (pri_num[i] + pri_num[j] == b)
        {
            cout << pri_num[i] << " " << pri_num[j] << endl;
            pri_num.erase(pri_num.begin() + i);
            pri_num.erase(pri_num.begin() + j);
            i = 0, j = pri_num.size();
        }
        else if (pri_num[i] + pri_num[j] < b)
        {
            i += 1;
        }
        else if (pri_num[i] + pri_num[j] > b)
        {
            j -= 1;
        }
    }
}